/**
 * 用户类型定义
 */
export interface User {
  id: number;
  username: string;
  nickname?: string;
  avatar?: string;
  role: number; // 1普通 2开发者 3管理员
  devProfile?: DeveloperProfile;
  createdAt: string;
}

/**
 * 开发者信息
 */
export interface DeveloperProfile {
  company?: string;
  website?: string;
  bio?: string;
  contactEmail?: string;
}

/**
 * 用户角色枚举
 */
export enum UserRole {
  USER = 1,
  DEVELOPER = 2,
  ADMIN = 3
}

/**
 * 用户状态枚举
 */
export enum UserStatus {
  DISABLED = 0,
  ENABLED = 1
}

/**
 * 用户信息接口
 */
export interface UserInfo {
  id: number;
  username: string;
  nickname: string;
  email: string;
  avatar: string;
  role: UserRole;
  status: UserStatus;
  createdAt: string;
  updatedAt: string;
}

/**
 * 通知
 */
export interface Notification {
  id: number
  title: string
  content: string
  time: string
  read: boolean
}

/**
 * 登录参数接口
 */
export interface LoginParams {
  username: string;
  password: string;
  remember?: boolean;
}

/**
 * 注册参数接口
 */
export interface RegisterParams {
  username: string;
  password: string;
  email: string;
  nickname?: string;
  code: string;
}

/**
 * 用户列表查询参数
 */
export interface UserQueryParams {
  username?: string;
  nickname?: string;
  email?: string;
  role?: UserRole;
  status?: UserStatus;
  pageNum: number;
  pageSize: number;
}

/**
 * 用户列表响应
 */
export interface UserListResponse {
  list: UserInfo[];
  total: number;
  pageNum: number;
  pageSize: number;
}

/**
 * 用户角色选项
 */
export const userRoleOptions = [
  { label: '普通用户', value: UserRole.USER },
  { label: '开发者', value: UserRole.DEVELOPER },
  { label: '管理员', value: UserRole.ADMIN }
];

/**
 * 登录响应结果
 */
export interface LoginResult {
  token: string;
  user: User;
} 